package eraserhead.xml.request;

import xml.Message;
import client.ServerAccess;

/**
 * Class for sending an Admin request.
 * @author Michael Checca
 */
public class AdminRequest {
	/**
	 * Sends a AdminRequest to the server.
	 * @param sa {@link ServerAccess} to send request the {@link Message to}
	 * @param username Username of the admin
	 * @param password Password of the admin
	 */
	public static void send(ServerAccess sa, String username, String password) {
		String xmlMessage = String.format(
				"%s<adminRequest> <user name=\"%s\" password=\"%s\"/> </adminRequest> </request>",
				Message.requestHeader(), username, password);
		sa.sendRequest(new Message(xmlMessage));
	}
}
